myApp.factory('$class', ['$q', '$http', function($q, $http){
	var cla = {
		allClass: [{"name": "数据还没初始化！"}],
		loadAllClass: function() {
			var defer = $q.defer();
			$http.get('searchAllClass').then(function successCallback(response) {
				defer.resolve(response.data);
			}, function errorCallback(response) {
				console.log("fail：" + response);
			});
			return defer.promise;
		}
	}; 
	return cla;
}]);